package com.qidian.mes.pojo;

import com.alibaba.excel.annotation.ExcelProperty;
import com.alibaba.excel.annotation.write.style.ColumnWidth;
import com.alibaba.excel.annotation.write.style.ContentRowHeight;
import com.alibaba.excel.annotation.write.style.HeadRowHeight;
import com.qidian.mes.excel.ToolStatusConverter;
import org.springframework.format.annotation.DateTimeFormat;

import java.time.LocalDateTime;
import java.util.Date;

/**
 * @Author 陆雯城
 * @Description
 * @Time 2024-04-08 15:24
 */
@HeadRowHeight(25) // 表头行高
@ContentRowHeight(20) // 内容行高
@ColumnWidth(20) // 列宽
public class Tool {
    @ExcelProperty(value = "工装夹具ID", index = 0)
    private Long toolId; // 工装夹具ID
    @ExcelProperty(value = "工装夹具编码", index = 1)
    private String toolCode; // 工装夹具编码
    @ExcelProperty(value = "工装夹具名称", index = 2)
    private String toolName; // 工装夹具名称
    @ExcelProperty(value = "工装夹具品牌", index = 3)
    private String brand; // 品牌
    @ExcelProperty(value = "工装夹具型号", index = 4)
    private String spec; // 型号
    @ExcelProperty(value = "工装夹具类型ID", index = 5)
    private Long toolTypeId; // 工装夹具类型ID
    @ExcelProperty(value = "工装夹具类型名称", index = 6)
    private String toolTypeName; // 工装夹具类型名称
    @ExcelProperty(value = "库存数量", index = 7)
    private Integer stock; // 库存数量
    @ExcelProperty(value = "可用数量", index = 8)
    private Integer quantityAvail; // 可用数量
    @ExcelProperty(value = "保养维护类型", index = 9)
    private String maintenType; // 保养维护类型
    @ExcelProperty(value = "下次保养周期", index = 10)
    private Integer nextMaintenPeriod; // 下一次保养周期
    @ExcelProperty(value = "下次保养日期", index = 11)
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    private Date nextMaintenDate; // 下一次保养日期
    @ExcelProperty(value = "状态", index = 12,converter = ToolStatusConverter.class)
    private Integer status; // 状态（1在库，2被领用，3报废，4维修中，99删除）
    @ExcelProperty(value = "备注", index = 13)
    private String remark; // 备注
    @ExcelProperty(value = "创建时间", index = 14)
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    private Date createTime; // 创建时间
    @ExcelProperty(value = "修改时间", index = 15)
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    private Date modifyTime; // 修改时间

    public Tool() {
    }

    public Tool(Long toolId, String toolCode, String toolName, String brand, String spec, Long toolTypeId, String toolTypeName, Integer stock, Integer quantityAvail, String maintenType, Integer nextMaintenPeriod, Date nextMaintenDate, Integer status, String remark, Date createTime, Date modifyTime) {
        this.toolId = toolId;
        this.toolCode = toolCode;
        this.toolName = toolName;
        this.brand = brand;
        this.spec = spec;
        this.toolTypeId = toolTypeId;
        this.toolTypeName = toolTypeName;
        this.stock = stock;
        this.quantityAvail = quantityAvail;
        this.maintenType = maintenType;
        this.nextMaintenPeriod = nextMaintenPeriod;
        this.nextMaintenDate = nextMaintenDate;
        this.status = status;
        this.remark = remark;
        this.createTime = createTime;
        this.modifyTime = modifyTime;
    }

    public Long getToolId() {
        return toolId;
    }

    public void setToolId(Long toolId) {
        this.toolId = toolId;
    }

    public String getToolCode() {
        return toolCode;
    }

    public void setToolCode(String toolCode) {
        this.toolCode = toolCode;
    }

    public String getToolName() {
        return toolName;
    }

    public void setToolName(String toolName) {
        this.toolName = toolName;
    }

    public String getBrand() {
        return brand;
    }

    public void setBrand(String brand) {
        this.brand = brand;
    }

    public String getSpec() {
        return spec;
    }

    public void setSpec(String spec) {
        this.spec = spec;
    }

    public Long getToolTypeId() {
        return toolTypeId;
    }

    public void setToolTypeId(Long toolTypeId) {
        this.toolTypeId = toolTypeId;
    }

    public String getToolTypeName() {
        return toolTypeName;
    }

    public void setToolTypeName(String toolTypeName) {
        this.toolTypeName = toolTypeName;
    }

    public Integer getStock() {
        return stock;
    }

    public void setStock(Integer stock) {
        this.stock = stock;
    }

    public Integer getQuantityAvail() {
        return quantityAvail;
    }

    public void setQuantityAvail(Integer quantityAvail) {
        this.quantityAvail = quantityAvail;
    }

    public String getMaintenType() {
        return maintenType;
    }

    public void setMaintenType(String maintenType) {
        this.maintenType = maintenType;
    }

    public Integer getNextMaintenPeriod() {
        return nextMaintenPeriod;
    }

    public void setNextMaintenPeriod(Integer nextMaintenPeriod) {
        this.nextMaintenPeriod = nextMaintenPeriod;
    }

    public Date getNextMaintenDate() {
        return nextMaintenDate;
    }

    public void setNextMaintenDate(Date nextMaintenDate) {
        this.nextMaintenDate = nextMaintenDate;
    }

    public Integer getStatus() {
        return status;
    }

    public void setStatus(Integer status) {
        this.status = status;
    }

    public String getRemark() {
        return remark;
    }

    public void setRemark(String remark) {
        this.remark = remark;
    }

    public Date getCreateTime() {
        return createTime;
    }

    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }

    public Date getModifyTime() {
        return modifyTime;
    }

    public void setModifyTime(Date modifyTime) {
        this.modifyTime = modifyTime;
    }

    @Override
    public String toString() {
        return "Tool{" +
                "toolId=" + toolId +
                ", toolCode='" + toolCode + '\'' +
                ", toolName='" + toolName + '\'' +
                ", brand='" + brand + '\'' +
                ", spec='" + spec + '\'' +
                ", toolTypeId=" + toolTypeId +
                ", toolTypeName='" + toolTypeName + '\'' +
                ", stock=" + stock +
                ", quantityAvail=" + quantityAvail +
                ", maintenType='" + maintenType + '\'' +
                ", nextMaintenPeriod=" + nextMaintenPeriod +
                ", nextMaintenDate=" + nextMaintenDate +
                ", status=" + status +
                ", remark='" + remark + '\'' +
                ", createTime=" + createTime +
                ", modifyTime=" + modifyTime +
                '}';
    }
}
